package com.baseinfinityrun;

import java.io.IOException;
import java.io.InputStream;

import com.badlogic.androidgames.framework.gl.Animation;
import com.badlogic.androidgames.framework.gl.Texture;
import com.badlogic.androidgames.framework.gl.TextureRegion;
import com.badlogic.androidgames.framework.impl.GLGame;

public class Assets
{
	public static Texture background, playerAtlas, obstacles, buttons;
	public static TextureRegion backgroundRegion, backgroundRegion2;
	public static TextureRegion barrel;
	public static TextureRegion menu, instruction;

	public static Animation player;
	
	public static InputStream child,present;

	public static void Load(GLGame game)
	{
		background = new Texture(game, "BG2.png");
		backgroundRegion = new TextureRegion(background,0,0,180,120);
		backgroundRegion2 = new TextureRegion(background,180,0,180,120);

		
		playerAtlas = new Texture (game, "walkanim.png");
		player = new Animation(0.2f, new TextureRegion(playerAtlas,0,0,64,64),
									 new TextureRegion(playerAtlas,64,0,64,64),
									 new TextureRegion(playerAtlas,128,0,64,64),
									 new TextureRegion(playerAtlas,192,0,64,64));
		
		obstacles = new Texture(game, "Obstacles.png");
		barrel = new TextureRegion(obstacles, 0,0,32,32);
		
		buttons = new Texture(game,"Buttons.png");
		menu = new TextureRegion(buttons,0,0,96,32);
		instruction = new TextureRegion(buttons,0,32,96,32);
		
		try
		{
			present = game.getFileIO().readAsset("present.xml");
			child = game.getFileIO().readAsset("child.xml");
		}
		
		catch(IOException e){}
	}
}
